<form class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true" method="post">
    <div class="layui-form-item">
        <blockquote class="layui-elem-quote">不想使用充值赠送功能，请将赠送价格设置为0</blockquote>
        <blockquote class="layui-elem-quote">此处的价格单位都为元</blockquote>
    </div>

    <div class="layui-form-item">

        <div class="layui-form-item">
            <label class="layui-form-label">充值金额</label>
            <div class="layui-input-block">
                <input type="text" name="recharge_amount" value='{$vo.recharge_amount|fenToyuan}' class="layui-input">
            </div>
        </div>

        <div class="hr-line-dashed"></div>

        <div class="layui-form-item">
            <label class="layui-form-label">赠送金额</label>
            <div class="layui-input-block">
                <input type="text" name="gift_amount" value='{$vo.gift_amount|fenToyuan}'   class="layui-input">
            </div>
        </div>
        <div class="layui-form-item text-center">
            <input type='hidden' value='{$vo.id}' name='id'>
            <button class="layui-btn" id="submit" type='submit'>保存数据</button>
            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
        </div>


</form>


<script type="text/javascript">
    $("#submit").click(
        function () {
            console.log($("input[name='recharge_amount']").val());
            if(parseFloat($("input[name='recharge_amount']").val())<=0){
                layer.msg('请选择正确充值金额', {icon: 2});
                return false;
            }
            if(parseFloat($("input[name='gift_amount']").val())<0){
                layer.msg('请选择正确赠送金额', {icon: 2});
                return false;
            }
        }
    );
</script>